---
title: Nexus
description: Learn how to use Nexus models in Agno.
---

Nexus is a routing platform that provides endpoints for various Large Language Models through a unified API interface.

Explore Nexus's capabilities and documentation [here](https://nexusrouter.com/).

## Authentication

Nexus requires API keys for the underlying model providers. Set the appropriate environment variables for the models you plan to use:

<CodeGroup>

```bash Mac
export OPENAI_API_KEY=***
export ANTHROPIC_API_KEY=***
```

```bash Windows
setx OPENAI_API_KEY ***
setx ANTHROPIC_API_KEY ***
```

</CodeGroup>

## Example

Use `Nexus` with your `Agent`:

<CodeGroup>

```python agent.py
from agno.agent import Agent
from agno.models.nexus import Nexus

agent = Agent(model=Nexus(id="anthropic/claude-sonnet-4-20250514"), markdown=True)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story")

```

</CodeGroup>

<Note> View more examples [here](/examples/models/nexus/basic). </Note>

## Params

| Parameter    | Type               | Default                        | Description                                                           |
| ------------ | ------------------ | ------------------------------ | --------------------------------------------------------------------- |
| `id`         | `str`              | `"gpt-4o-mini"`                | The id of the model to use through Nexus                             |
| `name`       | `str`              | `"Nexus"`                      | The name of the model                                                 |
| `provider`   | `str`              | `"Nexus"`                      | The provider of the model                                             |
| `api_key`    | `Optional[str]`    | `None`                         | The API key for Nexus (defaults to NEXUS_API_KEY env var)            |
| `base_url`   | `str`              | `"https://api.nexusflow.ai/v1"` | The base URL for the Nexus API                                      |

`Nexus` also supports the params of [OpenAI](/reference/models/openai).